import Cookies from 'js-cookie'

const TokenKey = 'jf_token'

export function getToken() {
    return Cookies.get(TokenKey)
}

export function setToken(token) {
    return Cookies.set(TokenKey, token)
}

export function removeToken() {
    return Cookies.remove(TokenKey)
}

export function sessionSet(name, data) {
    sessionStorage.removeItem(name)
    sessionStorage.setItem(name, data)
}

export function sessionGet(name) {
    return sessionStorage.getItem(name)
}
export function sessionRemove(name) {
    sessionStorage.removeItem(name)
}

export function localSet(name, data) {
    localStorage.removeItem(name)
    localStorage.setItem(name, data)
}
export function localGet(name) {
    return localStorage.getItem(name)
}
export function localRemove(name) {
    return localStorage.removeItem(name)
}